<template>
  <div class="login-container" :style="{ height: pageHeight + 'px' }">
    <!-- 入场动画门 -->
    <div class="cyber-gate gate-left" :class="{ 'gate-open': showContent }"></div>
    <div class="cyber-gate gate-right" :class="{ 'gate-open': showContent }"></div>

    <!-- 背景效果 -->
    <div class="bg-effects">
      <div class="matrix-bg"></div>
      <div class="grid-overlay"></div>
      <div class="particles-container">
        <div v-for="i in 20" :key="i" class="particle" :style="`--delay: ${i * 0.3}s`"></div>
      </div>
      <div class="light-beam light-beam-1"></div>
      <div class="light-beam light-beam-2"></div>
      <div class="circle-decoration"></div>
      <div class="hex-decoration"></div>
    </div>

    <div class="login-content" :class="{ 'content-visible': showContent }">
      <div class="login-card">
        <div class="card-header">
          <div class="logo-container">
            <div class="logo-bg"></div>
            <img src="../assets/yike.svg" class="logo">
            <div class="logo-ring"></div>
            <div class="logo-glow"></div>
          </div>

          <div class="title-container">
            <h1 class="title">访问<span class="highlight">博客系统</span></h1>
            <p class="subtitle">LOGIN TERMINAL // SYSTEM ACCESS</p>
          </div>

          <div class="status-indicator">
            <span class="status-dot"></span>
            <span class="status-text">系统在线</span>
            <span class="status-code">#9372-B</span>
          </div>
        </div>

        <div class="card-body">
          <div class="input-container username-container">
            <label for="username" class="input-label">用户标识</label>
            <div class="input-wrapper">
              <i class="input-icon user-icon"></i>
              <yk-input id="username" v-model="user.name" placeholder="输入访问凭证" class="cyber-input"
                @focus="inputFocus = 'username'" @blur="inputFocus = ''"></yk-input>
              <div class="input-glow" :class="{ active: inputFocus === 'username' }"></div>
              <div class="input-scan"></div>
            </div>
          </div>

          <div class="input-container password-container">
            <label for="password" class="input-label">密码密钥</label>
            <div class="input-wrapper">
              <i class="input-icon password-icon"></i>
              <yk-input id="password" v-model="user.psw" type="password" placeholder="输入安全密钥" class="cyber-input"
                @focus="inputFocus = 'password'" @blur="inputFocus = ''" @keyup.enter="submit"></yk-input>
              <div class="input-glow" :class="{ active: inputFocus === 'password' }"></div>
              <div class="input-scan"></div>
            </div>
          </div>

          <div class="button-container">
            <button class="login-button" @click="submit">
              <span class="btn-text">验证身份</span>
              <span class="btn-hover-effect"></span>
            </button>
            <div class="button-decoration left"></div>
            <div class="button-decoration right"></div>
          </div>

          <div class="register-link">
            <span>首次访问？</span>
            <router-link to="/register" class="link">
              <span>申请授权</span>
              <svg class="arrow-icon" viewBox="0 0 16 16">
                <path d="M8 0L6.59 1.41 12.17 7H0v2h12.17l-5.58 5.59L8 16l8-8-8-8z"></path>
              </svg>
            </router-link>
          </div>
        </div>

        <div class="card-footer">
          <div class="security-note">
            <i class="security-icon"></i>
            <span>加密连接已启用 · 安全协议v3.7</span>
          </div>
          <div class="footer-decoration"></div>
        </div>
      </div>
    </div>

    <!-- 装饰性界面元素 -->
    <div class="floating-elements">
      <div class="data-stream data-stream-1"></div>
      <div class="data-stream data-stream-2"></div>
      <div class="scanner-line"></div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted, getCurrentInstance } from 'vue';
import { signinAPI } from '@/api';
import { useRouter } from 'vue-router';
import { useCode } from '@/hooks/code';
import { useUserStore } from '@/stores/user';

const userStore = useUserStore();
const { tackleCode } = useCode();
const router = useRouter();
const proxy: any = getCurrentInstance()?.proxy;

const pageHeight = ref(window.innerHeight);
const showContent = ref(false);
const inputFocus = ref('');

// 用户
const user = ref({
  name: '',
  psw: ''
});

// 提交
const submit = async () => {
  if (user.value.name && user.value.psw) {
    // 显示登录中动画
    const loginButton = document.querySelector('.login-button');
    if (loginButton) {
      loginButton.classList.add('loading');
    }

    const data = {
      name: user.value.name,
      password: user.value.psw
    }

    try {
      const res: any = await signinAPI(data);

      // 移除加载状态
      if (loginButton) {
        loginButton.classList.remove('loading');
      }

      if (!tackleCode(res.code)) {
        proxy.$message({
          type: 'error',
          message: res.msg || '访问被拒绝，请验证凭证！'
        });
        // 添加错误动画
        const loginCard = document.querySelector('.login-card');
        if (loginCard) {
          loginCard.classList.add('error');
        }
        setTimeout(() => {
          const loginCard = document.querySelector('.login-card');
          if (loginCard) {
            loginCard.classList.remove('error');
          }
        }, 820);
        return;
      }

      // 成功动画
      const loginCard = document.querySelector('.login-card');
      if (loginCard) {
        loginCard.classList.add('success');
      }

      proxy.$message({
        type: 'success',
        message: '身份验证成功！'
      });

      // 登录成功，保存用户信息
      userStore.$patch({
        id: res.data.id,
        name: res.data.name,
        token: res.data.token,
      });

      // 短暂延迟后跳转，让用户看到成功动画
      setTimeout(() => {
        router.push({ path: '/' });
      }, 800);
      // eslint-disable-next-line @typescript-eslint/no-unused-vars
    } catch (error) {
      if (loginButton) {
        loginButton.classList.remove('loading');
      }
      proxy.$message({
        type: 'error',
        message: '连接异常，请重试！'
      });
    }
  } else {
    proxy.$message({
      type: 'warning',
      message: '请输入访问凭证和安全密钥',
    });
    const loginCard = document.querySelector('.login-card');
    if (loginCard) {
      loginCard.classList.add('shake');
    }
    setTimeout(() => {
      const loginCard = document.querySelector('.login-card');
      if (loginCard) {
        loginCard.classList.remove('shake');
      }
    }, 820);
  }
};

onMounted(() => {
  // 调整窗口大小
  window.addEventListener('resize', () => {
    pageHeight.value = window.innerHeight;
  });

  // 大门动画延迟
  setTimeout(() => {
    showContent.value = true;
  }, 300);

  // 初始化粒子动画
  const particles = document.querySelectorAll('.particle');
  particles.forEach((particle: any, index) => {
    particle.style.left = `${Math.random() * 100}%`;
    particle.style.top = `${Math.random() * 100}%`;
    particle.style.animationDelay = `${index * 0.2}s`;
    particle.style.animationDuration = `${10 + Math.random() * 20}s`;
  });
});
</script>

<style lang="less" scoped>
// 颜色变量
@primary-color: #00c8ff;
@secondary-color: #ff3d71;
@accent-color: #06f1b0;
@dark-bg: #0a0e17;
@card-bg: #10151e;
@light-line: rgba(0, 200, 255, 0.3);
@text-color: #e6f5ff;
@glow-effect: 0 0 10px rgba(0, 200, 255, 0.3), 0 0 20px rgba(0, 200, 255, 0.1);
@error-color: #ff3d71;

.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  background: @dark-bg;
  display: flex;
  align-items: center;
  justify-content: center;
  color: @text-color;
  font-family: 'SF Pro Display', 'Segoe UI', sans-serif;
  z-index: 100;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(16, 21, 30, 0.5) 0%, rgba(10, 14, 23, 0.9) 70%);
    z-index: 1;
  }
}

// 入场门动画
.cyber-gate {
  position: fixed;
  top: 0;
  height: 100vh;
  width: 51vw;
  background: @dark-bg;
  z-index: 1000;
  transition: transform 1.5s cubic-bezier(0.7, 0, 0.3, 1);

  &::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 2px;
    background: @primary-color;
    opacity: 0.7;
    box-shadow: @glow-effect;
  }

  &.gate-left {
    left: 0;
    transform: translateX(0);

    &::before {
      right: 0;
    }

    &.gate-open {
      transform: translateX(-100%);
    }
  }

  &.gate-right {
    right: 0;
    transform: translateX(0);

    &::before {
      left: 0;
    }

    &.gate-open {
      transform: translateX(100%);
    }
  }
}

// 背景特效
.bg-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;

  .matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><text x="10" y="15" fill="%2300aeff" font-family="monospace" font-size="10" opacity="0.3">10100110</text><text x="50" y="35" fill="%2300aeff" font-family="monospace" font-size="10" opacity="0.3">01101001</text><text x="90" y="55" fill="%2300aeff" font-family="monospace" font-size="10" opacity="0.3">11001010</text><text x="30" y="75" fill="%2300aeff" font-family="monospace" font-size="10" opacity="0.3">00110101</text><text x="70" y="95" fill="%2300aeff" font-family="monospace" font-size="10" opacity="0.3">10101100</text></svg>');
    opacity: 0.06;
    animation: matrix-fall 30s linear infinite;
  }

  .grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
      linear-gradient(to right, @light-line 1px, transparent 1px),
      linear-gradient(to bottom, @light-line 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) scale(2);
    transform-origin: center top;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
  }

  .light-beam {
    position: absolute;
    width: 150px;
    height: 1500px;
    background: linear-gradient(to bottom,
        rgba(0, 200, 255, 0) 0%,
        rgba(0, 200, 255, 0.05) 30%,
        rgba(0, 200, 255, 0.1) 50%,
        rgba(0, 200, 255, 0.05) 70%,
        rgba(0, 200, 255, 0) 100%);
    opacity: 0.5;
    transform: rotate(45deg);
    filter: blur(10px);

    &-1 {
      top: -300px;
      left: 20%;
      animation: beam-move 20s infinite alternate ease-in-out;
    }

    &-2 {
      top: -400px;
      right: 15%;
      animation: beam-move 25s infinite alternate-reverse ease-in-out;
    }
  }

  .circle-decoration {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    border: 1px solid @light-line;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 50px rgba(0, 200, 255, 0.1);
    opacity: 0.3;
  }

  .hex-decoration {
    position: absolute;
    width: 800px;
    height: 800px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><polygon points="50,3 91,25 91,75 50,97 9,75 9,25" fill="none" stroke="%2300aeff" stroke-width="0.5" opacity="0.3"/></svg>');
    background-size: 100px 100px;
    opacity: 0.1;
    animation: rotate 120s linear infinite;
  }
}

// 粒子效果
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;

  .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: @primary-color;
    border-radius: 50%;
    box-shadow: 0 0 6px @primary-color;
    animation: particle-float 15s infinite linear;
    opacity: 0.6;
  }
}

// 浮动元素
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 900;
  pointer-events: none;

  .data-stream {
    position: absolute;
    width: 1px;
    opacity: 0.5;
    background: @primary-color;
    box-shadow: 0 0 8px @primary-color;
    animation: data-stream-animation 5s infinite linear;

    &-1 {
      height: 70%;
      top: 0;
      left: 15%;
    }

    &-2 {
      height: 50%;
      bottom: 0;
      right: 20%;
      animation-delay: 2.5s;
    }
  }

  .scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right,
        rgba(0, 200, 255, 0),
        rgba(0, 200, 255, 0.5),
        rgba(0, 200, 255, 0));
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    z-index: 1000;
    animation: scan-animation 4s infinite;
  }
}

// 登录内容区域
.login-content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 500px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
  transition-delay: 0.8s;

  &.content-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

// 登录卡片
.login-card {
  position: relative;
  background: @card-bg;
  border-radius: 12px;
  padding: 30px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 200, 255, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, @primary-color, transparent);
    opacity: 0.8;
  }

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
      linear-gradient(to bottom right, rgba(255, 255, 255, 0.05), transparent),
      linear-gradient(to top left, rgba(0, 0, 0, 0.1), transparent);
    z-index: 1;
    pointer-events: none;
  }

  // 错误动画
  &.error {
    animation: card-error 0.82s cubic-bezier(.36, .07, .19, .97) both;
    border: 1px solid @error-color;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px @error-color,
      0 0 15px rgba(255, 61, 113, 0.2);
  }

  // 成功动画
  &.success {
    border: 1px solid @accent-color;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px @accent-color,
      0 0 15px rgba(6, 241, 176, 0.3);
  }

  // 震动动画
  &.shake {
    animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
  }
}

// 卡片头部
.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  position: relative;

  .logo-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin-right: 20px;
    flex-shrink: 0;

    .logo-bg {
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: rgba(16, 21, 30, 0.6);
      border: 1px solid rgba(0, 200, 255, 0.3);
      box-shadow: 0 0 15px rgba(0, 200, 255, 0.2);
    }

    .logo {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 70%;
      height: 70%;
      z-index: 2;
      filter: drop-shadow(0 0 5px rgba(0, 200, 255, 0.5));
    }

    .logo-ring {
      position: absolute;
      top: -5px;
      left: -5px;
      right: -5px;
      bottom: -5px;
      border: 1px dashed rgba(0, 200, 255, 0.3);
      border-radius: 50%;
      animation: rotate 10s linear infinite;

      &::before,
      &::after {
        content: '';
        position: absolute;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: @primary-color;
        top: 50%;
        box-shadow: 0 0 8px @primary-color;
      }

      &::before {
        left: -3px;
        transform: translateY(-50%);
      }

      &::after {
        right: -3px;
        transform: translateY(-50%);
      }
    }

    .logo-glow {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      background: radial-gradient(circle at center,
          rgba(0, 200, 255, 0.3) 0%,
          rgba(0, 200, 255, 0) 70%);
      filter: blur(5px);
      animation: pulse 3s infinite alternate ease-in-out;
    }
  }

  .title-container {
    flex: 1;

    .title {
      font-size: 28px;
      font-weight: 700;
      color: white;
      margin: 0 0 5px;
      letter-spacing: 1px;

      .highlight {
        color: @primary-color;
        text-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
      }
    }

    .subtitle {
      font-size: 12px;
      color: rgba(255, 255, 255, 0.5);
      margin: 0;
      letter-spacing: 1px;
      text-transform: uppercase;
    }
  }

  .status-indicator {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: @accent-color;
      margin-right: 6px;
      box-shadow: 0 0 8px @accent-color;
      animation: blink 2s infinite;
    }

    .status-text {
      margin-right: 5px;
    }

    .status-code {
      opacity: 0.5;
    }
  }
}

// 卡片主体
.card-body {
  position: relative;
  z-index: 2;

  .input-container {
    margin-bottom: 24px;

    .input-label {
      display: block;
      margin-bottom: 8px;
      font-size: 13px;
      color: rgba(255, 255, 255, 0.6);
      letter-spacing: 1px;
    }

    .input-wrapper {
      position: relative;

      .input-icon {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        width: 18px;
        height: 18px;
        z-index: 1;
        opacity: 0.7;
        transition: all 0.3s;
      }

      .user-icon {
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300c8ff"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>') no-repeat center center;
        background-size: contain;
      }

      .password-icon {
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300c8ff"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>') no-repeat center center;
        background-size: contain;
      }

      :deep(.cyber-input) {
        width: 100%;
        height: 52px;
        background: rgba(16, 21, 30, 0.6);
        border: 1px solid rgba(0, 200, 255, 0.2);
        color: white;
        padding-left: 45px;
        transition: all 0.3s;
        border-radius: 6px;
        font-family: inherit;
        letter-spacing: 0.5px;

        &:focus,
        &:hover {
          border-color: rgba(0, 200, 255, 0.5);
          background: rgba(6, 23, 44, 0.4);
          box-shadow: 0 0 5px rgba(0, 200, 255, 0.2);
        }

        &::placeholder {
          color: rgba(255, 255, 255, 0.3);
        }
      }

      // 输入框辉光
      .input-glow {
        position: absolute;
        bottom: 0;
        left: 15%;
        width: 70%;
        height: 1px;
        background: @primary-color;
        opacity: 0;
        transition: all 0.3s;
        transform: scaleX(0);
        transform-origin: center;
        box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);

        &.active {
          opacity: 1;
          transform: scaleX(1);
        }
      }

      // 扫描效果
      .input-scan {
        position: absolute;
        top: 0;
        left: 0;
        width: 3px;
        height: 100%;
        background: rgba(0, 200, 255, 0.3);
        opacity: 0;
        z-index: 0;
        box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);

        .input-wrapper:hover & {
          animation: input-scan 2s infinite ease-in-out;
          opacity: 1;
        }
      }
    }
  }

  // 按钮容器
  .button-container {
    position: relative;
    margin: 40px 0 30px;

    .login-button {
      position: relative;
      width: 100%;
      height: 54px;
      background: linear-gradient(to right,
          rgba(0, 150, 199, 0.8),
          rgba(0, 180, 216, 0.9),
          rgba(0, 150, 199, 0.8));
      border: none;
      border-radius: 6px;
      color: white;
      font-size: 18px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      letter-spacing: 1px;
      overflow: hidden;
      z-index: 2;
      transition: all 0.3s;
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);

      &::before {
        content: '';
        position: absolute;
        top: 1px;
        left: 1px;
        right: 1px;
        height: 50%;
        background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0));
        border-radius: 5px 5px 0 0;
        pointer-events: none;
      }

      .btn-hover-effect {
        position: absolute;
        top: 0;
        left: -100%;
        width: 300%;
        height: 100%;
        background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%);
        transform: skewX(-45deg);
        transition: all 0.5s;
      }

      &:hover {
        background: linear-gradient(to right,
            rgba(0, 180, 216, 0.9),
            rgba(0, 200, 255, 1),
            rgba(0, 180, 216, 0.9));
        box-shadow:
          0 5px 20px rgba(0, 0, 0, 0.3),
          0 0 20px rgba(0, 200, 255, 0.4);
        transform: translateY(-2px);

        .btn-hover-effect {
          animation: btn-shine 1.5s infinite;
        }
      }

      &:active {
        transform: translateY(1px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
      }

      // 加载中动画
      &.loading {
        background-image:
          linear-gradient(to right,
            rgba(0, 150, 199, 0.8),
            rgba(0, 180, 216, 0.9),
            rgba(0, 150, 199, 0.8)),
          linear-gradient(to right,
            transparent 25%,
            rgba(0, 200, 255, 0.5) 50%,
            transparent 75%);
        background-size: 100% 100%, 200% 100%;
        background-position: 0 0, -100% 0;
        animation: button-loading 1.5s infinite;
      }
    }

    // 按钮装饰
    .button-decoration {
      position: absolute;
      width: 30px;
      height: 1px;
      background: @primary-color;
      box-shadow: 0 0 10px @primary-color;

      &.left {
        top: 27px;
        left: -15px;
      }

      &.right {
        top: 27px;
        right: -15px;
      }
    }
  }

  // 注册链接
  .register-link {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 20px;

    span {
      margin-right: 8px;
    }

    .link {
      color: @primary-color;
      text-decoration: none;
      display: flex;
      align-items: center;
      transition: all 0.3s;
      position: relative;
      padding-bottom: 2px;

      &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background: @primary-color;
        transform: scaleX(0);
        transform-origin: right;
        transition: transform 0.3s ease;
      }

      .arrow-icon {
        width: 14px;
        height: 14px;
        margin-left: 4px;
        fill: currentColor;
        transition: transform 0.3s;
      }

      &:hover {
        color: white;
        text-shadow: 0 0 10px @primary-color;

        &::after {
          transform: scaleX(1);
          transform-origin: left;
        }

        .arrow-icon {
          transform: translateX(4px);
        }
      }
    }
  }
}

// 卡片底部
.card-footer {
  margin-top: 30px;
  position: relative;
  z-index: 2;

  .security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);

    .security-icon {
      width: 12px;
      height: 12px;
      background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2300c8ff" opacity="0.5"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"/></svg>') no-repeat center center;
      background-size: contain;
      margin-right: 6px;
      opacity: 0.8;
    }
  }

  .footer-decoration {
    position: absolute;
    bottom: -30px;
    left: 50%;
    width: 200px;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="30" viewBox="0 0 200 30"><path d="M0,0 L200,0 L180,30 L20,30 Z" fill="%231a2334" stroke="%2300aeff" stroke-width="0.5" opacity="0.5"/></svg>') no-repeat center center;
    transform: translateX(-50%);
  }
}

// 动画关键帧
@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.2;
    transform: scale(0.8);
  }

  100% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

@keyframes scan-animation {

  0%,
  100% {
    top: -2px;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  99% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes btn-shine {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes input-scan {
  0% {
    left: 0;
    opacity: 0.7;
  }

  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes shake {

  10%,
  90% {
    transform: translateX(-1px);
  }

  20%,
  80% {
    transform: translateX(2px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }

  40%,
  60% {
    transform: translateX(4px);
  }
}

@keyframes card-error {

  10%,
  90% {
    border-color: @error-color;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px @error-color,
      0 0 15px rgba(255, 61, 113, 0.3);
  }

  20%,
  80% {
    border-color: @error-color;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px @error-color,
      0 0 5px rgba(255, 61, 113, 0.1);
  }

  30%,
  50%,
  70% {
    border-color: @error-color;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px @error-color,
      0 0 20px rgba(255, 61, 113, 0.5);
  }

  40%,
  60% {
    border-color: @error-color;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px @error-color,
      0 0 10px rgba(255, 61, 113, 0.2);
  }

  0%,
  100% {
    border-color: rgba(0, 200, 255, 0.1);
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(0, 200, 255, 0.1);
  }
}

@keyframes matrix-fall {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 1000px;
  }
}

@keyframes beam-move {
  0% {
    transform: translateX(-100px) rotate(45deg);
    opacity: 0.04;
  }

  100% {
    transform: translateX(100px) rotate(45deg);
    opacity: 0.1;
  }
}

@keyframes particle-float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0.2;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    transform: translateY(-500px) translateX(100px);
    opacity: 0;
  }
}

@keyframes button-loading {
  0% {
    background-position: 0 0, -100% 0;
  }

  100% {
    background-position: 0 0, 100% 0;
  }
}

@keyframes data-stream-animation {
  0% {
    height: 0;
    top: 0;
    opacity: 0;
  }

  10% {
    opacity: 0.5;
  }

  90% {
    opacity: 0.5;
  }

  100% {
    height: 100%;
    top: 0;
    opacity: 0;
  }
}
</style>
